package com.ss.android.account.v2;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.ss.android.account.activity.AuthorizeActivity;
import com.ss.android.account.v2.view.AccountLoginActivity;
import com.ss.android.account.v2.view.AccountLoginActivity.AccountAction;

public class aa implements com.ss.android.account.v2.bb {
    private static aa a;
    private com.ss.android.account.v2.a.b b;

    private aa() {

    }

    public static aa getInstance() {
        if (a.a == null) {
            Class v1 = aa.class;
            synchronized (v1) {
                if (a.a == null) {
                    a.a = new aa();
                }
            }
        }
        return a.a;
    }

    public final Intent a(Context arg4, String arg5) {
        Intent v0_1;
        if (arg5 == null) {
            arg5 = "";
        }

        int v0 = -1;
        switch (arg5) {
            case "qzone_sns": {
                v0 = 2;
                break;
            }
            case "mobile": {
                v0 = 0;
                break;
            }
            case "weixin": {
                v0 = 1;
                break;
            }
            case "qq_weibo": {
                v0 = 4;
                break;
            }
            case "sina_weibo": {
                v0 = 3;
                break;
            }
            case "renren_sns": {
                v0 = 5;
                break;
            }
        }

        label_5:
        switch (v0) {
            case 0: {
                v0_1 = new Intent(arg4, AccountLoginActivity.class);
                v0_1.putExtra("extra_account_type", AccountAction.LOGIN);
                break;
            }
            case 1:
            case 2:
            case 3:
            case 4:
            case 5: {
                v0_1 = new Intent(arg4, AuthorizeActivity.class);
                v0_1.putExtra("platform", arg5);
                break;
            }
            default: {
                v0_1 = new Intent(arg4, AccountLoginActivity.class);
                v0_1.putExtra("extra_account_type", AccountAction.LOGIN);
                break;
            }
        }

        return v0_1;
    }

    public final void startAccountLoginActivity(Activity activity) {
        a.startAccountLoginActivity(((Context) activity), null);
    }

    public final void startAccountLoginActivity(Activity activity, Bundle bundle) {
        a.startAccountLoginActivity(activity, bundle);
    }

    public final void a(Context arg2) {
        a.startAccountLoginActivity(arg2, null);
    }

    public final void a(Context arg1, Bundle arg2) {
        a.startAccountLoginActivity(arg1, arg2);
    }

    public final void a(com.ss.android.account.v2.a.b arg1) {
        this.b = arg1;
    }

    public static void startAccountLoginActivity(Context context, Bundle bundle) {
        Intent intent = new Intent(context, AccountLoginActivity.class);
        if (bundle != null) {
            intent.putExtras(bundle);
        }
        intent.putExtra("extra_account_type", AccountAction.LOGIN);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    public final com.ss.android.account.v2.a.b b() {
        if (this.b == null) {
            this.b = new com.ss.android.account.v2.a.a();
        }

        return this.b;
    }
}

